Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SubscribingHandlerInterface::getSubscribingMethods() return iterable #1227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simPod
Copy link
Contributor

@simPod simPod commented Jul 4, 2020

I'm using generators inside of this method so this would allow them to be used officially

Q A
Bug fix? no
New feature? no
Doc updated no
BC breaks? yes
Deprecations? no
Tests pass? yes
License MIT

@goetas
Copy link
Collaborator

goetas commented Jul 4, 2020

is adding this method signature a BC break? how would it behave if someone tries to override it ?

@simPod
Copy link
Contributor Author

simPod commented Jul 4, 2020

You're right, it was array before so it's BC

@goetas goetas added this to the v4.0 milestone Jul 9, 2020
@proggeler
Copy link

If this is a BC break I would suggest to make this function no longer static. It is not used that way.

@simPod
Copy link
Contributor Author

simPod commented Dec 17, 2020

Not sure if it's BC break. array is covariant to iterable.

@Tobion
Copy link
Contributor

Tobion commented Apr 24, 2021

The BC break is that implementations of the interface without the return type won't work anymore due to signature incompatibility.

@simPod
Copy link
Contributor Author

simPod commented Jul 29, 2021

@Tobion afaik implementations of the interface without the return type are compatible

interface Foo
{
    public function fcn() : iterable;
}

class Bar implements Foo
{
    public function fcn()
    {
    }
}

@Tobion
Copy link
Contributor

Tobion commented Aug 5, 2021

No it's not: https://3v4l.org/c8lWB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants